package com.dgshanger.sanhxiaofeisc.mvp.model

import com.dgshanger.sanhxiaofeisc.common.AppApi
import com.dgshanger.sanhxiaofeisc.entity.GoodsDetailsEntity
import com.dgshanger.sanhxiaofeisc.mvp.contract.GoodsDetailsContract
import com.xx.baseutilslibrary.network.rx.RxHelper
import com.xx.baseutilslibrary.network.rx.XxBaseHttpObserver

/**
 * Created by JacobHHH on 2018/4/20.
 */
class GoodsDetailsModel : GoodsDetailsContract.Model {

    override fun loadData(good_id: String?, httpObserver: XxBaseHttpObserver<GoodsDetailsEntity>?) {
        AppApi.Api().getGoodsDetailsData(good_id)
                .compose(RxHelper.io_main())
                .compose(RxHelper.start_finish(httpObserver))
                .subscribe(httpObserver)
    }
}